package cn.zhx.infrastructure.persistent.dao;

import cn.bugstack.middleware.db.router.annotation.DBRouter;
import cn.bugstack.middleware.db.router.annotation.DBRouterStrategy;
import cn.zhx.infrastructure.persistent.po.UserRaffleOrder;
import org.apache.ibatis.annotations.Mapper;

/**
 * @author zhx
 * @description 用户抽奖订单表
 * @create 2024/07/16
 */
@Mapper
@DBRouterStrategy(splitTable = true)
public interface IUserRaffleOrderDao {
    /**
     * 查询未使用的抽奖订单 order_state = 'create'
     * @param userRaffleOrderReq userRaffleOrderReq
     * @return UserRaffleOrder
     */
    @DBRouter
    UserRaffleOrder queryNoUsedRaffleOrder(UserRaffleOrder userRaffleOrderReq);

    /**
     * 插入订单
     * @param userRaffleOrder 用户活动订单
     */
    void insert(UserRaffleOrder userRaffleOrder);

    int updateUserRaffleOrderStateUsed(UserRaffleOrder userRaffleOrderReq);
}
